//package com.demo.config;
//
//
//import com.demo.restResult.ResultCode;
//import com.demo.util.ResponseUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.security.access.AccessDeniedException;
//import org.springframework.security.web.access.AccessDeniedHandler;
//import org.springframework.stereotype.Component;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * AccessDeniedHandler用来解决认证过的用户访问无权限资源时的异常
// * @author lirong
// * @date
// */
//@Component("securityAccessDeniedHandler")
//@Slf4j
//public class SecurityAccessDeniedHandler implements AccessDeniedHandler {
//
//	@Override
//	public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException){
//		log.info(request.getRequestURL()+"没有权限");
//		ResponseUtils.renderJson(request, response, ResultCode.LIMITED_AUTHORITY, null);
//		//response.getWriter().print(JSONObject.toJSONString(RestMsg.error("没有访问权限!")));
//	}
//}
